package com.example.flow.enums;

/**
 * 流程审批结果
 * @author safe
 * @date 2021/1/30
 */
public enum EnumApproveResult {
    ADOPT("adopt", "通过"),
    REFUSE("refuse", "拒绝");

    /** 码值 */
    private String code;

    /** 描述 */
    private String desc;

    EnumApproveResult(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EnumApproveResult find(String code) {
        if (code == null) {
            return null;
        }
        for (EnumApproveResult e : EnumApproveResult.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
    }
